<%@page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/pages/common/taglib.jsp"%>
<!doctype html>
<html>
  <head>
	<!--声明当前页面的编码集：charset=gbk,gb2312(中文编码)，utf-8国际编码-->
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<!--当前页面的三要素-->
	<title>陇上无限学——陇南情Malron</title>
	<meta name="Keywords" content="关键词,关键词">
	<meta name="description" content="">
	<link rel="icon" href="${basePath}/resources/images/tmtitle.png">
	<link rel="icon" href="${basePath}/resources/images/tmtitle.png" type="image/x-icon" />
	<!--css,js-->
	<link rel="stylesheet" type="text/css" href="${basePath}/resources/css/regist.css" />
	<%@include file="../common/common.jsp" %>
	<script type="text/javascript" src="${basePath}/resources/js/jquery.validate.js"></script>
	<script type="text/javascript" src="${basePath}/resources/js/jquery.metadata.js"></script>
	<script type="text/javascript" src="${basePath}/resources/js/resgin.js"></script>
	<script type="text/javascript" src="../resources/js/dialogLogin/dialogLogin.js"></script>
  </head>
<body style="overflow:hidden">
<!--top start-->
<%@include file="../common/head.jsp" %>
<!--top start-->
<div class="wrapper">
	<div class="title">新用户注册</div>
    <form id="signupForm" method="post" action="" class="zcform">
		<p class="clearfix">
        	<span class="one" for="username">姓名：</span>
            <input id="username" name="username" autofocus="autofocus" class="" type="text" placeholder="请输姓名" />
        </p>
		<p class="clearfix">
        	<span class="one" for="account">帐号：</span>
            <input id="account" name="account" class="{required:true,rangelength:[6,20],}" type="text" placeholder="请输帐号/邮箱/手机号" />
        </p>
        <!-- 
        <p class="clearfix">
        	<span class="one" for="idcard">身份证号：</span>
        	<input id="idcard" name="idcard" class="{required:true,rangelength:[18,18],}" placeholder="请输入您的身份证号" />
        </p>
         -->
        <p class="clearfix">
         	<span class="one"  for="password">登录密码：</span>
        	<input id="password" name="password" type="password" class="{required:true,rangelength:[8,20],}" placeholder="请输入密码" />
        </p>
        <!-- 
        <p class="clearfix">
        	<span class="one" for="confirm_password">确认密码：</span>
        	<input id="confirm_password" name="confirm_password" type="password" class="{required:true,equalTo:'#password'}" value placeholder="请再次输入密码" />
        </p>
         -->
		<p class="clearfix">
			<span class="one" for="email">电子邮箱：</span>
			<input id="email" name="email" type="email" class="" placeholder="请输入电子邮箱" />
		</p>
		<!-- 		
		<p class="clearfix">
			<span class="one" for="age">年龄：</span>
			<input id="age" name="age" type="text" class="" placeholder="请输入年龄" />
		</p>
		 -->
		<p class="clearfix">
			<span class="one" for="address">家庭住址：</span>
			<input id="address" name="address" type="text" class="" placeholder="请输入住址" />
		</p>
        <p class="clearfix">
        	<span class="one" for="telphone">联系电话：</span>
        	<input id="telphone" name="telphone" type="text" class="required" placeholder="请输入你的手机号" />
        </p>
        <p class="clearfix agreement">
        	<label class="degree"><input type="checkbox" class="checked"/><b class="left">已阅读并同意 </b></label><b class="left"><a href="javascript:void(0)">《用户协议》</a></b>
        </p>
       	<p class="clearfix"><input class="submit" type="button" onclick="tz_addUsers();" value="立即注册"/><a type="button" onclick="tmDialogLogin()" class="login">立即登录&gt;</a></p>
    </form>
</div>
<!--bottom start-->
<%@include file="../common/bottom.jsp" %>
<!--bottom end-->
<script type="text/javascript">
	function tz_addUsers(){
		/* #username,#account,#idcard,#password,#confirm_password,#email,#age,#address,#telphone */
		/* var type = $("select.type option:selected").val();
		var pay =  $("select.pay option:selected").val(); */
		var username = $("#username").val();
		var account = $("#account").val();
//		var idcard = $("#idcard").val();
		var password = $("#password").val();
//		var pwd = $("#confirm_password").val();
		var email = $("#email").val();
		var age = $("#age").val();
		var address = $("#address").val();
		var telphone = $("#telphone").val();
// 		var checked = $("checkbox.checked:selected").val();
// 		alert(checked);
		var params = {
				"username":username,
				"account":account,
//				"idcard":idcard,
				"password":password,
//				"pwd":pwd,
				"email":email,
				"age":age,
				"address":address,
				"telphone":telphone
		}; 
		//var params = $("#addUser").serialize();
		$.ajax({
			type:"post",
			url:"${basePath}/stage/regested",
			data:params,
			success:function(data){
				if(data=="success"){
					tzMessage.tip("恭喜您，注册成功请登录！");
					tmDialogLogin();
				}else{
					tzMessage.tip("对不起，注册失败请重新重新注册！");
					$("#username").select();
				}
			}
		});
	}
	//显示错误信息
	function tm_showmessage(message){
		$("#message").show().html(message).stop(true,true).fadeOut(3000);
	}
</script>
<body>
</body>
</html>